/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-29 08:42:51
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-30 10:46:33
 */
import { legacy_createStore as createStore, applyMiddleware } from 'redux'
import rootReducers from './reducers'
import thunk, { ThunkAction } from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'
import { TypeChannelAction } from './actions/channel'
const store = createStore(
  rootReducers,
  composeWithDevTools(applyMiddleware(thunk))
)

export type RootState = ReturnType<typeof store.getState>

export type RootThunkAction = ThunkAction<
  void,
  RootState,
  unknown,
  TypeChannelAction
>

export default store
